package com.zigin.healthcard.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.zigin.healthcard.dao.BaseMapper;
import com.zigin.healthcard.service.BaseService;

/**
 *  Service层默认业务逻辑实现类，增删改查等基础实现
 * @ClassName: AbstractServiceImpl
 * @author mgw1986
 * @date 2019-10-22 9:26:46
 * @version V1.0
 */
public abstract class AbstractServiceImpl<T, ID extends Serializable> implements BaseService<T, ID> {

	@Override
	public abstract BaseMapper<T, ID> getMapper();

	@Override
	public int deleteByPrimaryKey(ID id) {
		return getMapper().deleteByPrimaryKey(id);
	}

	@Override
	public int deleteByCondition(Map<String, Object> paramMap) {
		return getMapper().deleteByCondition(paramMap);
	}

	@Override
	public int insert(T record) {
		return getMapper().insert(record);
	}

	@Override
	public int insertSelective(T record) {
		return getMapper().insertSelective(record);
	}
	
	@Override
    public int insertBath(List<T> list) {
        return getMapper().insertBath(list);
    }

	@Override
	public T selectByPrimaryKey(ID id) {
		return getMapper().selectByPrimaryKey(id);
	}

	@Override
	public List<T> selectAllList() {
		return getMapper().selectAllList();
	}

	@Override
	public List<T> selectListByPage(Map<String, Object> paramMap) {
		return getMapper().selectListByPage(paramMap);
	}

	@Override
	public List<T> selectListByCondition(Map<String, Object> paramMap) {
		return getMapper().selectListByCondition(paramMap);
	}

	@Override
	public int selectCount(Map<String, Object> paramMap) {
		return getMapper().selectCount(paramMap);
	}

	@Override
	public int updateByPrimaryKey(T record) {
		return getMapper().updateByPrimaryKey(record);
	}

	@Override
	public int updateByPrimaryKeySelective(T record) {
		return getMapper().updateByPrimaryKeySelective(record);
	}

}
